<script setup>
import { computed } from "vue";
import { useRoute, useRouter } from "vue-router";
import { mockTest } from "@/api/test.js";

const router = useRouter();
const route = useRoute();

const search = computed({
  get() {
    return route.query.search ?? "";
  },
  set(search) {
    router.replace({ query: { search } });
  },
});

function clickMe() {
  mockTest().then((res) => {
    console.log(res);
  });
}
</script>

<template>
  <RouterLink to="/system/users/111">user_111</RouterLink>
  <RouterLink to="/system/users/222">user_222</RouterLink>
  <RouterLink to="/system/users/333">user_333</RouterLink>
  <RouterLink to="/system/users/444">user_444</RouterLink>
  <button @click="clickMe">mock测试</button>
</template>

<style scoped></style>
